#! /usr/bin/env python

import rospy
from std_msgs.msg import String

if __name__ == '__main__':
    rospy.init_node('ergouzi_py')
    pub = rospy.Publisher("che", String, queue_size=10)
    rate = rospy.Rate(1) # 10hz
    rospy.sleep(3) # 3 seconds to allow all the prerequisites to be set up
    msg = String()
    count = 0
    while not rospy.is_shutdown():
        count += 1
        msg.data = "Hello ----------> " + str(count)
        pub.publish(msg)
        rospy.loginfo("发布的数据是：%s", msg.data)
        rate.sleep()
